package com.chidopi.market.bookstore.service.impl;

import java.util.Arrays;
import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;

import com.chidopi.cdf.dao.IBaseDao;
import com.chidopi.cdf.service.IBaseService;
import com.chidopi.market.bookstore.domain.ProductID2Book;


public class ProductID2BookServiceImpl implements IBaseService<ProductID2Book> {
	
	private static Logger logger = LoggerFactory.getLogger(ProductID2BookServiceImpl.class);
	
	@Autowired
	@Qualifier("productID2BookDao")
	private IBaseDao<ProductID2Book> baseDao;
	
	@Override
	public int insert(ProductID2Book t) throws Exception {
		return this.baseDao.insert(t);
	}

	@Override
	public int update(ProductID2Book t) throws Exception {
		return this.baseDao.update(t);
	}

	@Override
	public int delete(ProductID2Book t) throws Exception {
		return this.baseDao.delete(t);
	}

	@Override
	public List<ProductID2Book> find(String sqlWhere, Object... args) throws Exception {
		logger.debug(sqlWhere);
		logger.debug(Arrays.asList(args).toString());
		return this.baseDao.find(sqlWhere, args);
	}

	@Override
	public ProductID2Book findById(Object id) throws Exception {
		ProductID2Book provider = this.baseDao.findById(id);
		
		return provider;
	}

	@Override
	public int getNextSequence() throws Exception {
		return 0;
	}

}
